<template>
    <div id='teml'>
        <ul class="mui-table-view mui-table-view-chevron">
				<li class="mui-table-view-cell mui-media" v-for="item in list">
					<router-link v-bind="{to:'/news/newsinfo/'+item.id}" class="mui-navigate-right" >
						<img class="mui-media-object mui-pull-left" :src="item.img_url">
						<div class="mui-media-body">
							{{item.title}}
							<p class='mui-ellipsis'>{{item.zhaiyao}}</p>
                            <div class='time_click'>
                                <span>{{item.add_time | datefmt('YYYY-MM-DD HH:mm:ss')}}</span>
                                <span class='click_right'>{{item.click}}次点击量</span>
                            </div>
						</div>
					</router-link>
				</li>
			
			</ul>
    </div>
</template>


<script>
//导入公共的url地址
import common from '../../kikt/comment.js'
import { Toast } from 'mint-ui';
    export default {
        data(){
            return {
                list:[],
                id:0
            }
        },
        created(){
            this.getnewsList()
        },
        methods: {
            getnewsList:function(){
                var url = common.apidomain + '/api/getnewslist';
                this.$http.get(url).then(function(response){
                    var data = response.body;
                    if(data.status != 0){
                        Toast(data.message);
                        return;
                    }
                    this.list = data.message;
                })
            }
        }
    }
</script>


<style scoped>
    .mui-table-view .mui-media-object.mui-pull-left {
        width:80px;
        height:80px;
    }
    .mui-table-view .mui-media-object {
        max-width:80px;
        line-height:80px;
    }
    .mui-media-body p {
        margin-top:5px;
    }
    .time_click {
        margin-top:13px;
        font-size:14px;
        color:#007ACC;
    }
    .click_right {
        float:right;
    }
</style>
